package com.liwenfeng.diancanspringboot.mapper;

import com.liwenfeng.diancanspringboot.pojo.entity.DishFlavor;
import org.apache.ibatis.annotations.*;

import java.util.List;

@Mapper
public interface DishFlavorMapper {
    @Delete("delete from dish_flavor where id = #{id}")
    void delete(Long id);

    @Insert("insert into dish_flavor(dish_id, name, value) values(#{dishId}, #{name}, #{value})")
    void insert(DishFlavor dishFlavor);

    @Select("select * from dish_flavor where dish_id = #{dishId}")
    List<DishFlavor> getByDishId(Long dishId);

    void insertBatch(List<DishFlavor> flavors);

    @Delete("delete from dish_flavor where dish_id = #{dishId}")
    void deleteByDishId(Long dishId);

    void deleteByDishIds(List<Long> dishIds);

}
